#include "mainwindow.h"
#include<QSoundEffect>
#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QSoundEffect*music=new QSoundEffect();
       music->setSource(QUrl::fromLocalFile(":/new/prefix1/sample.wav"));
       music->setLoopCount(QSoundEffect::Infinite);  //设置无限循环
       music->setVolume(0.5f);  //设置音量，在0到1之间
       music->play();
    MainWindow w;
    w.show();
    return a.exec();
}
